<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/WEB-INF/faces/template.xhtml">
        <ui:define name="title">Edit users</ui:define>

        <ui:define name="content">
            <!-- Check admin login -->
            <ui:include src="/resources/include/checkAdminLogin.xhtml" />
            
                <h:form>            
                    <p:dataTable id="users" value="#{viewUsersControllerBean.user}" var="user">

                        <p:column sortBy="#{user.name}" >
                            <f:facet name="header">
                                <h:outputText value="Username" />
                            </f:facet>
                            <h:inputText value="#{user.name}" />
                        </p:column>

                        <p:column sortBy="#{user.pwd}" >
                            <f:facet name="header">
                                <h:outputText value="Password" />
                            </f:facet>
                            <h:inputText value="#{user.pwd}" />
                        </p:column>

                        <p:column sortBy="#{user.email}" >
                            <f:facet name="header">
                                <h:outputText value="Email" />
                            </f:facet>
                            <h:inputText value="#{user.email}" />
                        </p:column>
                        
                        <p:column sortBy="#{user.auth}" >
                            <f:facet name="header">
                                <h:outputText value="Auth" />
                            </f:facet>
                            <h:inputText value="#{user.auth}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Edit" />
                            </f:facet>
                            <h:commandButton value="Edit" action="#{viewUsersControllerBean.edit(user)}" />
                        </p:column>
                        
                    </p:dataTable>
                </h:form>
        </ui:define>




    </ui:composition>


</html>

